package com.lanou.controller;

import com.lanou.pojo.ConfigFeeItemEntity;
import com.lanou.service.ConfigFeeItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName ConfigFeeItemController
 * @Description: TODO
 * @Author 郅占伟
 * @Date 2023年10月26日
 * @Version: 1.0
 */
@Api(value = "收费项管理",tags = "收费项信息")
@RestController
public class ConfigFeeItemController {

    @Autowired
    private ConfigFeeItemService configFeeItemService;

    @ApiOperation(value = "获取数据",httpMethod = "GET")
    @RequestMapping(value = "/getConfigFeeItemList", produces = "text/html;charset=UTF-8")
    public String getConfigFeeItemList(String pageNum, String pageSize, String type, String name) {
        return configFeeItemService.getConfigFeeItemList(pageNum, pageSize, type, name);
    }


    @ApiOperation(value = "添加收费项",httpMethod = "POST")
    @RequestMapping("/addConfigFeeItem")
    public String addConfigFeeItem(@RequestBody Map<String, String> map) {
        return configFeeItemService.addConfigFeeItem(map);
    }

    @ApiOperation(value = "删除收费项",httpMethod = "GET")
    @RequestMapping("/deleteConfigFeeItemById")
    public void deleteConfigFeeItem(String id) {
        configFeeItemService.deleteConfigFeeItemById(id);
    }

    @ApiOperation(value = "修改收费项",httpMethod = "POST")
    @RequestMapping(value = "modifyConfigFeeItemById",produces = "text/html;charset=UTF-8" )
    public String updateConfigFeeItemById(@RequestBody ConfigFeeItemEntity configFeeItemEntity){

        return  configFeeItemService.updateConfigFeeItemById(configFeeItemEntity);
    }
}
